<template>
	<view class="uni-container">
		<uni-list class="marginBottom20">
			<uni-list-item :title="username" thumb="../../static/touxiang.png" thumb-size="lg" />
			<uni-list-item title="版本号：V1.1" />
		</uni-list>
		
		<view class="uni-list" style="margin-top: 20rpx;" >
			<view class="uni-list-cell uni-list-cell-pd" >
				<view style="color:#F00" @click="logoutSubmit">退出登录</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { getUserName } from '@/utils/auth.js'
	export default {
		data() {
			return {
				username: undefined
			}
		},
		onShow() 
		{
			this.username = getUserName();
		},
        methods: {
			logoutSubmit() {
				this.$store.dispatch('user/logout').then(() => {
					uni.reLaunch({ url:'/pages/login/index' })
				});
			}
		}
	}
</script>

